import request from "@/utils/newrequst";

// 采购计划
// 供应商管理列表查询
export const GetPurchaseListApi = (data: any) => {
  return request({
    url: `/purchase/v1/public/supplier/page`, method: "post", data
  });
};
// 查询采购参数
export const GetPurchaseParamListApi = (data: any) => {
  return request({
    url: `/purchase/v1/public/param-setting/list`, method: "post", data
  });
};
// 批量修改采购参数
export const EditPurchaseParamListApi = (data: any) => {
  return request({
    url: `/purchase/v1/public/param-setting/batch-edit`, method: "post", data
  });
};
// 添加供应商
export const AddPurchaseParamApi = (data: any) => {
  return request({
    url: `/purchase/v1/public/supplier/add`, method: "post", data
  });
};
// 编辑供应商
export const EditPurchaseParamApi = (data: any) => {
  return request({
    url: `/purchase/v1/public/supplier/edit`, method: "post", data
  });
};
// 物价更新列表获取
export const GetPurchaseSkuSupplyListApi = (data: any) => {
  return request({
    url: `/purchase/v1/public/sku-supply/page`, method: "post", data
  });
};
// 物价查询列表获取
export const GetNewestChaseSkuSupplyListApi = (data: any) => {
  return request({
    url: `/purchase/v1/public/sku-supply/newest-details-page`, method: "post", data
  });
};
// 物价更新详情 /purchase/v1/public/sku-supply/details-page
export const GetNewestdetailsListApi = (data: any) => {
  return request({
    url: `/purchase/v1/public/sku-supply/details-page`, method: "post", data
  });
};
// 物价更新excel数据上传 
export const GetExceldataListApi = (data: any) => {
  return request({
    url: `/purchase/v1/public/sku-supply/submit-import-excel-data`, method: "post", data
  });
};
// 物价更新 excel临时表请求
export const GetTempExceldataListApi = (data: any) => {
  return request({
    url: `/purchase/v1/public/sku-supply/details-temp-page`, method: "post", data
  });
};
// 编辑excel错误数据
export const EditTempExceldataApi = (data: any) => {
  return request({
    url: `/purchase/v1/public/sku-supply/edit-details-temp`, method: "post", data
  });
};
//删除excel临时数据 
export const DeleteTempExceldataApi = (data: any) => {
  return request({
    url: `/purchase/v1/public/sku-supply/delete-details-temp`, method: "post", data
  });
};
// 新增采购计划 物价更新
export const AddPurchaseSkuSupplyApi = (data: any) => {
  return request({
    url: `/purchase/v1/public/sku-supply/add`, method: "post", data
  });
};
// 供应单位列表获取
export const GetkitchenListApi = () => {
  return request({
    url: `/system/v1/tenant/list-sub-kitchen`, method: "post", data: {}
  });
};
// 供应历史列表
export const GetSkuHistoryPurchaseListApi = (data: any) => {
  return request({
    url: `/purchase/v1/public/sku-history-supply/page`, method: "post", data
  });
};
// 供应历史折线图详情
export const GetChartDataApi = (data: any) => {
  return request({
    url: `/purchase/v1/public/sku-history-supply/details-line-chart-data`, method: "post", data
  });
};
// 供应历史表格详情
export const GetPurchaseHistoryDetailsApi = (data: any) => {
  return request({
    url: `/purchase/v1/public/sku-history-supply/details-page`, method: "post", data
  });
};
// 启用物价更新
export const EnablePurchaseSupplyApi = (data: any) => {
  return request({
    url: `/purchase/v1/public/sku-supply/enable`, method: "post", data
  });
};
// 结束物价更新
export const EndPurchaseSupplyApi = (data: any) => {
  return request({
    url: `/purchase/v1/public/sku-supply/end`, method: "post", data
  });
};
// 删除物价更新
export const DetetePurchaseSupplyApi = (data: any) => {
  return request({
    url: `purchase/v1/public/sku-supply/delete`, method: "post", data
  });
};
// 删除供应商
export const DeteteSupplierApi = (data: any) => {
  return request({
    url: `/purchase/v1/public/supplier/delete`, method: "post", data
  });
};
// 校验供应商编码是否存在 
export const GetCheckCodeExistApi = (data: any) => {
  return request({
    url: `/purchase/v1/public/supplier/check-code-exist`, method: "post", data
  });
};
// 检验供应商名称是否存在
export const GetCheckNameExistApi = (data: any) => {
  return request({
    url: `/purchase/v1/public/supplier/check-name-exist`, method: "post", data
  });
};
// 中心端采购订单列表
export const GetOrderListApi = (data: any) => {
  return request({
    url: `/purchase/v1/public/purchase-order/page`, method: "post", data
  });
};
// 统计未审核采购单数量
export const getUnauditedCount = (data: any) => {
  return request({
    url: `/purchase/v1/public/purchase-order/unaudited-count`, method: "post", data
  });
};
// 到处采购订单
export const ExportOrderBlodApi = (data: any) => {
  return request({
    url: `/purchase/v1/public/purchase-order/export-excel`, method: "post", data,
    responseType: 'blob'
  });
};
// 采购订单明细
export const GetOrderDetailsListApi = (data: any) => {
  return request({
    url: `/purchase/v1/public/purchase-order/details-page`, method: "post", data
  });
};
// 采购订单审核
export const GetOrderExamineApi = (data: any) => {
  return request({
    url: `/purchase/v1/public/purchase-order/examine`, method: "post", data
  });
};
// 采购订单撤销
export const GetOrderRevokeApi = (data: any) => {
  return request({
    url: `/purchase/v1/public/purchase-order/revoke`, method: "post", data
  });
};
// 采购订单汇总列表
export const GetSummaryListApi = (data: any) => {
  return request({
    url: `/purchase/v1/public/purchase-summary/page`, method: "post", data
  });
};
// 采购订单汇总详情
export const GetSummaryDetailsListApi = (data: any) => {
  return request({
    url: `/purchase/v1/public/purchase-summary/details-page`, method: "post", data
  });
};
// 采购订单汇总导出功能
export const ExportSummaryrBlodApi = (data: any) => {
  return request({
    url: `/purchase/v1/public/purchase-summary/export-excel`, method: "post", data,
    responseType: 'blob'
  });
};
// 采购计划商品汇总
export const GetSkuSummaryListApi = (data: any) => {
  return request({
    url: `/purchase/v1/public/purchase-summary/sku-page`, method: "post", data
  });
};
// 商品汇总导出excel
export const ExportSkuSummaryBlodApi = (data: any) => {
  return request({
    url: `/purchase/v1/public/purchase-summary/sku-export-excel`, method: "post", data,
    responseType: 'blob'
  });
};
// 物价更新导出excel 
export const ExportSkuSupplyBlodApi = (data: any) => {
  return request({
    url: `/purchase/v1/public/sku-supply/export-excel`, method: "post", data,
    responseType: 'blob'
  });
};
// 物价更新新增外部编码主动触发更新excel表
export const restartSkuSupplyExeclApi = (data: any) => {
  return request({
    url: `/purchase/v1/public/sku-supply/restart-details-temp`, method: "post", data
  });
};
// 中心端采购订单批量审核
export const ExamineOrderBatchApi = (data: any) => {
  return request({
    url: `/purchase/v1/public/purchase-order/batch-examine`, method: "post", data
  });
};
// 中心端采购订单批量撤销
export const RevokeOrderBatchApi = (data: any) => {
  return request({
    url: `/purchase/v1/public/purchase-order/batch-revoke`, method: "post", data
  });
};
// 订货方案分页
export const GetOrderPlanPageApi = (data: any) => {
  return request({
    url: `/purchase/v1/public/order-plan/page`, method: "post", data
  });
};
// 提交导入订货方案excel
export const SubmitOrderPlanExcelApi = (data: any) => {
  return request({
    url: `/purchase/v1/public/order-plan-details-temp/submit-import-excel-data`, method: "post", data
  });
};
// 查看订货方案Excel详情数据
export const GetOrderPlanExcelApi = (data: any) => {
  return request({
    url: `/purchase/v1/public/order-plan-details-temp/page`, method: "post", data
  });
};
//更新订货方案新增外部编码情况
export const restartOrderPlanExcelApi = (data: any) => {
  return request({
    url: `/purchase/v1/public/order-plan-details-temp/restart-check`, method: "post", data
  });
};
// 编辑订货方案临时表单个
export const editOrderPlanExcelTempApi = (data: any) => {
  return request({
    url: `/purchase/v1/public/order-plan-details-temp/edit`, method: "post", data
  });
};
// 删除订货方案临时数据/purchase/v1/public/order-plan-details-temp/delete
export const DeleteOrderPlanExcelTempApi = (data: any) => {
  return request({
    url: `/purchase/v1/public/order-plan-details-temp/delete`, method: "post", data
  });
};
// 新增订货方案
export const addOrderPlanApi = (data: any) => {
  return request({
    url: `/purchase/v1/public/order-plan/add`, method: "post", data
  });
};
// 查看订货方案明细
export const getOrderPlanDetailApi = (data: any) => {
  return request({
    url: `/purchase/v1/public/order-plan-details/page`, method: "post", data
  });
};
// 保存订货方案
export const SaveOrderPlanApi = (data: any) => {
  return request({
    url: `/purchase/v1/public/order-plan/save`, method: "post", data
  });
};
// 启用订货方案
export const EnableOrderPlanApi = (data: any) => {
  return request({
    url: `/purchase/v1/public/order-plan/enable`, method: "post", data
  });
};
// 禁用订货方案
export const disabledOrderPlanApi = (data: any) => {
  return request({
    url: `/purchase/v1/public/order-plan/disabled`, method: "post", data
  });
};
// 删除订货方案
export const DeleteOrderPlanApi = (data: any) => {
  return request({
    url: `/purchase/v1/public/order-plan/delete`, method: "post", data
  });
};
